﻿<style type="text/css">
    /*转币*/
    body{background: #e7eaf1}
    .currency-content{width: 95%;margin: 0 auto;background: #fff;padding-bottom: 25px;}
    .content-date{margin-left: 15px;margin-right: 15px;padding-top: 15px;}
    .data-a{color:#2f406b;font-weight: 700;font-size: 16px;}
    .data-a span i{color:#2f406b;font-size: 20px;margin-right: 5px;position: relative;top: 2px; }
    .data-b{height: 50px;background:#f6f6f6;margin-top: 15px; }
    .data-b input,
    .data-b select{height: 50px;font-size: 15px;text-indent: 10px;float: left;background: none;border: none;width: 70%;}
    .data-b select{width:100%;}
    .data-search{float:right;margin-top: 12px;}
    .data-search i{font-size: 25px;color:#2f406b;margin-right: 10px; }
    .date-sys{float:right;width: 50px;height: 50px;background: #2f406b;text-align: center;}
    .date-sys i{font-size: 25px;margin-top: 3px;display: block;margin-bottom: 2px;}
    .date-sys span{display: block;color: #fff;font-size: 12px;}
    .currency-a a {display: block; padding:12px 0px; color: #fff; background: #43527f; margin-top: 12px; text-align: center;position: fixed;bottom: 0px; width: 100%}
    @media screen and (max-width: 320px) {
        .data-b input{width: 50%;}
    }
</style>
<div style="height:20px; "></div>
<div class="currency-a"> <a v-on:click="submit">确认转出</a></div>
<div class="currency-content validate-area">
    <div class="content-date">
        <div class="data-list">
            <p class="data-a"><span><i class="iconfont icon-jingshi"></i></span>您将转账</p>
            <div class="data-b">
                <input id="memberid" type="text" class="validate-elem" :value="address" validate="true" validate-message="请输入对方账号" placeholder="请输入对方账号">
                <p v-on:click="scan" class="date-sys">
                    <span><i class="iconfont icon-saoyisao"></i></span>
                    <span>扫码</span>
                </p>
                <p class="data-search"><i class="iconfont icon-31sousuo"></i></p>
            </div>
        </div>
        <div class="data-list" style="margin-top: 25px;">
            <div class="data-b">
                <select id="type" type="text" class="validate-elem" validate="true" validate-message="请选择账户种类">
                    <option value="">请选择</option>
                    <option :value="account.type" v-for="account in bag.basis.info.accounts">
                        {{ account.code }} (可用:{{ account.money }})
                    </option>
                </select>
            </div>
        </div>
        <div class="data-list" style="margin-top: 25px;">
            <div class="data-b">
                <input id="amount" type="text" class="validate-elem" validate="true" validate-message="请输入数量" placeholder="请输入数量">
            </div>
        </div>
        <div class="data-list" style="margin-top: 25px;">
            <div class="data-b">
                <input id="remarks" type="text" class="validate-elem" placeholder="备注">
            </div>
        </div>
        <div class="data-list" style="margin-top: 25px;" v-if="bag.basis.info.issetsafeword == false">
            <div class="data-b">
                <input id="safeword" type="password" class="validate-elem" validate="true" validate-message="请输入交易密码" placeholder="请输入交易密码">
            </div>
        </div>
    </div>
</div>
<div style="height:60px;"></div>
<script type="text/javascript">
    var pagedata = {
        request: {
            method: "VIEW_STOCK_TRANSFER",
            address: mview.view.chlid.param.address
        },
        screen: {
            header_title_name: "付款",
            header_display: true,
            footer_display: false,
            footer_choose: "product"
        },
        data: {
            address: mview.view.chlid.param.address

        },
        methods: {
            submit: function () {
                mview.view.form.validate("validate-area", function (data) {
                    mview.socket.send({
                        data: {
                            method: "STOCK_TRANSFER",
                            safeword: data.safeword || "",
                            amount: data.amount,
                            memberid: data.memberid,
                            type: data.type
                        },
                        success: function (data) {
                            if (data.Code == 0) {
                                mview.view.load("views/stock/deallists.html");
                            }
                            else {
                                mview.control.tips(data.Message);
                            }
                        }
                    });
                });
            },
            scan: function () {
                mview.app.scan(function (key, data) {
                    if (key != "PAY") {
                        mview.control.tips("二维码不正确");
                    }
                    else {
                        pagedata.data.address = data;
                    }
                });
            }

        }
    }
    mview.view.chlid.init(pagedata);
</script>